import axios from "../../axios";

//通过id获取user信息
export const getuserInfo = (param) => {
  return axios.request({
    url: "/shops/user/update/updateUserBasicMessage",
    method: "PUT",
    params: param,
  });
};

//----------------------------------------------------------------------------------------------------
// 修改头像
export const editHeadimg = (param, formdata) => {
  return axios.request({
    url: "/shops/user/update/updateUserAvatar",
    method: "PUT",
    params: param,
    data: formdata,
    maxContentLength: Infinity,
    maxRedirects: 5,
    maxBodyLength: Infinity,
  });
};
// 修改基本信息
export const editUserinfo = (param) => {
  return axios.request({
    url: "/shops/user/update/updateUserBasicMessage",
    method: "PUT",
    params: param,
  });
};
// 修改密码
export const editPassword = (param) => {
  return axios.request({
    url: "/shops/user/update/updateUserPassword",
    method: "PUT",
    params: param,
  });
};
// 绑定邮箱
export const bindingEmail = (param) => {
    return axios.request({
      url: "/shops/user/update/bindingEmail",
      method: "PUT",
      params: param,
    });
};
// 解绑邮箱
export const unbindEmail = (param) => {
    return axios.request({
      url: "/shops//user/update/unBoundEmail",
      method: "PUT",
      params: param,
    });
};
// 发送验证码
export const sendCode = (param) => {
    return axios.request({
      url: "/shops/login_and_register/email/sendMailCode",
      method:'POST',
      params: param,
    });
};

//------------------------------------------------------------------------------------------------------
// 上传身份证
export const uploadIDcard = (param, formdata) => {
    return axios.request({
      url: "/shopper/store/authentication",
      method: "POST",
      params: param,
      data: formdata,
      maxContentLength: Infinity,
      maxRedirects: 5,
      maxBodyLength: Infinity,
    });
};
